@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <form data-validate="parsley" method="post">
            {!! csrf_field() !!}
            <section class="panel panel-default">
                <header class="panel-heading">
                    {{ $frame['title'] }}
                    <a href="{{ route('admin.index.area') }}" class="btn btn-xs btn-default pull-right">地区</a>
                </header>
                <div class="panel-body">
                    <p class="text-muted">添加的地区将出现在配置信息的默认地区以及经营范围中</p>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-6">
                            <label>地区名称</label>
                            <input type="text" class="form-control parsley-validated" data-required="true" name="name">
                        </div>
                        <div class="col-sm-6">
                            <label>地区标识
                                <small class="text-small">地区标识是在网站超链接中区别不同企业分站的参数,<b class="text-danger">只支持字母!</b>
                                </small>
                            </label>
                            <input type="text" class="form-control parsley-validated" data-required="true"
                                   name="domain">
                        </div>
                    </div>
                    <div class="form-group">
                        <label>所属地区</label>
                        <div class="clearfix"></div>
                        <select style="width:100%" class="chosen-select" name="parent">
                            <option value="0">请选择地区,不选择则为省级</option>
                            @foreach( $areas as $lv => $chunk )
                                <optgroup label="{{ $lv }}">
                                    @foreach($chunk as $area)
                                        <option value="{{ $area['id'] }}">{{ $area['name'] }}</option>
                                    @endforeach
                                </optgroup>
                            @endforeach
                        </select>
                    </div>
                    <div class="checkbox i-checks">
                        <label>
                            <input type="checkbox" name="status" checked class="parsley-validated">
                            <i></i>
                            勾选此项,才会出现
                            <a href="{{ route('admin.index.set') }}" class="text-info">配置信息</a>
                            中的默认地区和经营范围中!
                        </label>
                    </div>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" class="btn btn-success btn-s-xs">保存</button>
                </footer>
            </section>
        </form>
    </div>
@endsection

@section('css')
    <link rel="stylesheet" href="/public/theme/js/chosen/chosen.css" type="text/css"/>
@endsection

@section('js')
    <!-- Chosen -->
    <script src="/public/theme/js/chosen/chosen.jquery.min.js"></script>
    <!-- parsley -->
    <script src="/public/theme/js/parsley/parsley.min.js"></script>
    <script src="/public/theme/js/parsley/parsley.extend.js"></script>
@endsection